package com.ruoyi.slope.device.errLog.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.slope.device.errLog.mapper.SlopeDeviceErrlogMapper;
import com.ruoyi.slope.device.errLog.domain.SlopeDeviceErrlog;
import com.ruoyi.slope.device.errLog.service.ISlopeDeviceErrlogService;

/**
 * 异常日志Service业务层处理
 * 
 * @author psy
 * @date 2025-05-01
 */
@Service
public class SlopeDeviceErrlogServiceImpl implements ISlopeDeviceErrlogService 
{
    @Autowired
    private SlopeDeviceErrlogMapper slopeDeviceErrlogMapper;

    /**
     * 查询异常日志
     * 
     * @param id 异常日志主键
     * @return 异常日志
     */
    @Override
    public SlopeDeviceErrlog selectSlopeDeviceErrlogById(Long id)
    {
        return slopeDeviceErrlogMapper.selectSlopeDeviceErrlogById(id);
    }

    /**
     * 查询异常日志列表
     * 
     * @param slopeDeviceErrlog 异常日志
     * @return 异常日志
     */
    @DataScope(deptAlias = "s")
    @Override
    public List<SlopeDeviceErrlog> selectSlopeDeviceErrlogList(SlopeDeviceErrlog slopeDeviceErrlog)
    {
        return slopeDeviceErrlogMapper.selectSlopeDeviceErrlogList(slopeDeviceErrlog);
    }

    /**
     * 新增异常日志
     * 
     * @param slopeDeviceErrlog 异常日志
     * @return 结果
     */
    @Override
    public int insertSlopeDeviceErrlog(SlopeDeviceErrlog slopeDeviceErrlog)
    {
        return slopeDeviceErrlogMapper.insertSlopeDeviceErrlog(slopeDeviceErrlog);
    }

    /**
     * 修改异常日志
     * 
     * @param slopeDeviceErrlog 异常日志
     * @return 结果
     */
    @Override
    public int updateSlopeDeviceErrlog(SlopeDeviceErrlog slopeDeviceErrlog)
    {
        slopeDeviceErrlog.setUpdateTime(DateUtils.getNowDate());
        return slopeDeviceErrlogMapper.updateSlopeDeviceErrlog(slopeDeviceErrlog);
    }

    /**
     * 批量删除异常日志
     * 
     * @param ids 需要删除的异常日志主键
     * @return 结果
     */
    @Override
    public int deleteSlopeDeviceErrlogByIds(Long[] ids)
    {
        return slopeDeviceErrlogMapper.deleteSlopeDeviceErrlogByIds(ids);
    }

    /**
     * 删除异常日志信息
     * 
     * @param id 异常日志主键
     * @return 结果
     */
    @Override
    public int deleteSlopeDeviceErrlogById(Long id)
    {
        return slopeDeviceErrlogMapper.deleteSlopeDeviceErrlogById(id);
    }
}
